Sponsored content commonly is placed on documents that are distributed to consumers of content on the Internet. Such sponsored content can be selected by selection engine that receives keywords or other query terms or other information (hereinafter just “query terms”) as an input. The selection engine in turn selects sponsored content that matches or otherwise is associated with the provided query terms.
The query terms used to select sponsored content may come from a variety of sources. In some implementations, the query terms are derived from a target document, which will ultimately be modified to contain the sponsored content. Content of the target document can be analyzed to identify one or more query terms, represented for example by words and phrases. Sponsored content can also be associated with words and phrases, which are referred to herein as “item phrases.” A matching operation can be performed between the query terms derived from the target document and item phrases associated with sponsored content in repository to select an item of sponsored content.